import request from "@/utils/request.js"

const name="pay"

export default {
	getList(){
		return request({
			url:`/${name}`,
			method:'get'
		});
	},
	findAll(type,page,size){
		return request({
			url:`/${name}/${type}/${page}/${size}`,
			method:'get'
		});
	},
	findAllByType(type){
		return request({
			url:`/${name}/type/${type}`,
			method:'get'
		});
	},
	search(searchMap,page,size){
		return request({
			url:`/${name}/search/${page}/${size}`,
			method:'post',
			data:searchMap
		});
	},
	save(pojo){
		return request({
			url:`/${name}`,
			method:'post',
			data:pojo
		});
	},
	findById(id){
		return request({
			url:`/${name}/${id}`,
			method:'get',
		});
	},
	update(id,pojo){
		if(id==null||id==''){
			return this.save(pojo)
		}
		return request({
			url:`/${name}`,
			method:'put',
			data:pojo
		});
	},
	deleteById(id){
		return request({
			url:`/${name}/${id}`,
			method:'delete',
		});
	}
}